﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using ERP.ERPSystem.ProductionSystem.Dto;
using ERP.Team.ProductionSystem;
using ERP.Common.Results;

namespace ERP.ERPSystem.ProductionSystem
{
    /// <summary>
    /// 生产系统-生产管理-生产领料
    /// </summary>
    public interface IProductionpickingService:IApplicationService
    {
        /// <summary>
        /// 添加生产领料单
        /// </summary>
        /// <param name="dto">生产领料DTO</param>
        /// <returns>返回添加结果</returns>
        Task<int> AddProductionPickingAsync(ProductionpickingDTO dto);
        
        /// <summary>
        /// 获取所有生产领料单
        /// </summary>
        /// <returns>生产领料单列表</returns>
        Task<APIPaging<ProductionpickingModel>> GetAllProductionPickingAsync(string? code, string? IssuanceOrderName, string? IssuanceWarehouse, DateTime? IssuanceDate, string Documentstatus, int page = 1, int limit = 10);

        /// <summary>
        /// 根据ID获取生产领料单详情
        /// </summary>
        /// <param name="id">领料单ID</param>
        /// <returns>生产领料单详情</returns>
        Task<ProductionpickingModel> GetProductionPickingByIdAsync(int id);

        /// <summary>
        /// 执行开票 - 更新单据状态为已完成
        /// </summary>
        /// <param name="id">领料单ID</param>
        /// <returns>更新结果</returns>
        Task<bool> ExecuteInvoiceAsync(int id);

        /// <summary>
        /// 修改生产领料单
        /// </summary>
        /// <param name="dto">生产领料DTO</param>
        /// <returns>修改结果</returns>
        Task<bool> UpdateProductionPickingAsync(ProductionpickingDTO dto);

        /// <summary>
        /// 删除生产领料单
        /// </summary>
        /// <param name="id">领料单ID</param>
        /// <returns>删除结果</returns>
        Task<bool> DeleteProductionPickingAsync(int id);
    }
}
